


//竞赛组队

import java.util.Arrays;
import java.util.Scanner;

public class DAY1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNext()){
            int n= scanner.nextInt();
            long[] array=new long[n*3];
            for (int i = 0; i < n*3; i++) {
                array[i]= scanner.nextLong();
            }
            Arrays.sort(array);
            long sum=0;
            for (int i = 0; i < n; i++) {
                sum+=array[array.length-(2*(i+1))];
            }
            System.out.println(sum);
        }
    }
}
